#include <stdio.h>
#include <unistd.h>
#include <sys/sysinfo.h>

int main(int argc,char *argv[])
{
	struct sysinfo sys;
	int err = sysinfo(&sys);
	printf("\n\nerror code is: %d\n", err);

	printf( "free mem:\t%lu\n"
			"total mem:\t%lu\n"
			"buffer mem:\t%lu\n"
			"memunit:\t%u\n",
			sys.freeram, sys.totalram, sys.bufferram,sys.mem_unit
		  );

	return 0;
}
